home *** CD-ROM | disk | FTP | other *** search
/ United Public Domain Gold 2 / United Public Domain Gold 2.iso / business / pb016.dms / pb016.adf / Config!H < prev    next >
Text File  |  1992-06-18  |  16KB  |  611 lines

  1. -----------------------------------------------------------------------------
  2. |                              Config!H                                        |
  3. |         Copyright (C) 1986-92 Rick Stiles.  All rights reserved.            |
  4. -----------------------------------------------------------------------------
  5.  
  6. *************************************
  7. N-variables used:
  8. n0-n4    scratch num variables
  9. n24 split window size
  10. n25 hyper word index value
  11.  
  12. Buffers used:
  13. buf50-buf54 scratch buffers
  14. buf49    search/grep string
  15. buf60    bookmark names
  16. buf63    hyper text filename
  17. buf64    hyper text tablename
  18. *************************************
  19.  
  20. HYPER TEXT COMMANDS ((This rewrite of the hyper text cmds was inspired by
  21. cmds sent in by Piotr Obminski.  RS 27-Jan-92))
  22.  
  23. <defines:
  24. define(MAX_WORD_LENGTH ,17)
  25. define(HT_DIRECTORY ,"S:Hyper")
  26.  
  27. define(HT_Split_Size    ,n24)
  28. define(Word_Index    ,n25)
  29. define(Hyper_Word    ,buf54)
  30.  
  31. define(HT_FileName ,buf63)
  32. define(HT_TableName ,buf64)
  33.  
  34. define(Eat_MouseUp_Input,624)
  35.  
  36. define(Hyper_Lookup ,1054)
  37. define(Capture_Word ,1068)
  38. define(Open_Hyper_Text ,1083)
  39. define(Close_Hyper_Text ,1084)
  40.  
  41. define(Type_In_Hyper_Word,rAmiga-gadget1)
  42.  
  43. define(N_1 ,n1)
  44. define(N_2 ,n2)
  45. define(N_3 ,n3)
  46. define(N_4 ,n4)
  47. define(B_0 ,buf50)
  48. define(B_1 ,buf51)
  49. >
  50.  
  51. Open hyper text facility for HyperHelp
  52. <Open_Hyper_Text:
  53.     freeBuf(B_1)
  54.     freeBuf(B_0)
  55.     insertRgn(B_0,eFile,HT_DIRECTORY,all)
  56.     insertRgn(B_1,eFile,B_0,all)
  57.     insertRgn(B_1,eFile,"/FILES",all)
  58.     if (!fileRequest(B_1,"Select HyperText File",0)) {
  59. label(0)
  60.         putMsg("No selection - Hyper Text is inactive.")
  61.         returnFalse
  62.     }
  63.  
  64.     moveCursor(B_1,sFile)
  65.     moveCursor(B_1,downLine)
  66.     freeBuf(HT_FileName)
  67.     insertRgn(HT_FileName,sFile,B_1,line)
  68.     if (isEmpty(HT_FileName)) goto label(0)
  69.  
  70.     freeBuf(HT_TableName)
  71.     insertRgn(HT_TableName,eFile,HT_FileName,all)
  72.     insertRgn(HT_TableName,eFile,".tbl",all)
  73.     freeBuf(B_1)
  74.     insertRgn(B_1,eFile,B_0,all)
  75.     insertRgn(B_0,eFile,"/Files/",all)
  76.     insertRgn(B_1,eFile,"/Tables/",all)
  77.     insertRgn(B_0,eFile,HT_FileName,all)
  78.     insertRgn(B_1,eFile,HT_TableName,all)
  79.  
  80.     hyperClose
  81.     if (HyperOpen(B_0,B_1,0)) {
  82.         if (thisKey) putmsg("Hyper text loaded")
  83.         equateNum(Word_Index,0)
  84.         insertRgn(HT_FileName,sFile,"<FILE: ",all)
  85.         insertRgn(HT_FileName,eFile,">",all)
  86.         returnTrue
  87.     }
  88. >
  89.  
  90. Close hyper text facility
  91. <Close_Hyper_Text: HyperClose >
  92.  
  93. Get word input and lookup hyper word, going into hyper text mode
  94. <Type_In_Hyper_Word:
  95.     if (!hyperUp & !runKey(Open_Hyper_Text))
  96.             { putMsg("Must open hyper text") returnFalse }
  97.     putmsg("Input hyper word/phrase to look up:")
  98.     clearBuf(Hyper_Word)
  99.     inputString(Hyper_Word)
  100.     updateDisplay
  101.     runKey(Hyper_Lookup)
  102. >
  103.  
  104. Get hyper word that was clicked, go into hyper text mode & find it
  105. <rAmiga-buttondown:
  106.     putMsg(" ") putMsg("")
  107.     updateDisplay
  108.     if (!hyperUp & !runKey(Open_Hyper_Text)) returnFalse
  109.     runKey(Capture_Word)
  110.     runKey(Hyper_Lookup)
  111. >
  112.  
  113. Capture hyper word or phrase
  114. <Capture_Word:
  115.     define(Word_Length,n2)
  116.     define(Word_Byte,n3)
  117.  
  118.     movecursor(curfile,mouseloc)
  119. ..    if (is(curFile,whiteSpace) | is(curFile,eFile)) return
  120.  
  121.     clearBuf(Hyper_Word)
  122.     if (!is(curfile,sword)) movecursor(curfile,sword)
  123.     while (!is(curfile,"<")
  124.                 & !is(curfile,eline)
  125.                     & !is(curfile,">")
  126.                         & movecursor(curfile,schar)) nothing
  127.     if (is(curfile,"<")) {                 .. copy the hyper phrase
  128.         movecursor(curfile,echar)
  129.         equateNum(Word_Length,0)
  130.         while (nothing) {
  131.             copychar(curfile,Word_Byte)
  132.             movecursor(curfile,echar)
  133.             if (eqnum(Word_Byte,">")) GOTO label(0)
  134.             insertchar(Hyper_Word,Word_Byte)
  135.             incNum(Word_Length)
  136.             if (geNum(Word_Length,MAX_WORD_LENGTH)) GOTO label(0)
  137.         }
  138.         label(0)
  139.     } else {                                            .. copy just the word
  140.         movecursor(curfile,mouseloc)
  141.         if (!is(curfile,sword)) movecursor(curfile,sword)
  142.         insertrgn(Hyper_Word,efile,curfile,word)
  143.     }
  144. >
  145.  
  146. Hyper lookup mode
  147. <Hyper_Lookup:
  148.     define(Old_CurFile          ,n0)
  149.     define(Hyper_Text_Buf        ,buf53)
  150.     define(Hyper_Text_Buf2      ,buf52)
  151.     define(Forbid_Tiny_Window    ,label(40))
  152.     define(Paint_Options        ,label(50))
  153.     define(Lookup_Hyper_Word    ,label(96))
  154.     define(Lookup_From_Top      ,label(97))
  155.     define(Get_Next_Input        ,label(98))
  156.     define(Eat_MouseUp_Input    ,624)
  157.  
  158.     runKey(Eat_MouseUp_Input)
  159.     while(inputKey(N_4)) nothing
  160.     if (gtNum(0,Word_Index)) equateNum(Word_Index,0)
  161.     equateNum(Old_CurFile,curFile)
  162.  
  163.     .. find word starting from Word_Index
  164.     if (!hyper(Hyper_Text_Buf,Hyper_Word,Word_Index,0)) {
  165.         clearBuf(Hyper_Word)
  166.  
  167.         .. find word starting from top of table
  168.         if (!hyper(Hyper_Text_Buf,Hyper_Word,0,0)) return
  169.     }
  170.     if (!eqNum(curFile,Hyper_Text_Buf) & !gotoSplit(Hyper_Text_Buf)) {
  171.         getAddress(15,N_4)      .. get maxLines
  172.         peek(N_4,N_3,2)
  173.         sub(N_3,N_3,7)          .. subtract lines needed
  174.         equateNum(HT_Split_Size,N_3)
  175.         if (!splitWindow(Hyper_Text_Buf,HT_Split_Size)) {
  176.             putMsg("Close a split window so can bring up hyper text")
  177.             return
  178.         }
  179.     }
  180.     updateDisplay
  181.     GOSUB Paint_Options
  182.     GOSUB Forbid_Tiny_Window
  183.  
  184. Get_Next_Input
  185.     GOSUB Forbid_Tiny_Window
  186.     runKey(Eat_MouseUp_Input)
  187.     getKeyVal(macroNum,inputChar)
  188.     GOSUB Forbid_Tiny_Window
  189.  
  190.     switch(macroNum) {
  191.         case(normal-gadget3)
  192.         case(normal-n) {
  193.             if (!runKey(Open_Hyper_Text)) GOTO label(39)
  194.             equateNum(Word_Index,0)
  195.             clearBuf(Hyper_Word)
  196.             GOSUB Paint_Options
  197.             GOTO Lookup_From_Top
  198.         }
  199.         case(normal-gadget4)
  200.         case(normal-c) { hyperClose goto label(39) }
  201.         case(normal-space)
  202.         case(normal-return) {
  203.             equateLoc(curfile,mouseloc,atcursor)
  204.             runkey(Capture_Word)
  205.             GOTO Lookup_Hyper_Word
  206.         }
  207.         case(normal-q)
  208.         case(normal-gadget1)
  209.         case(normal-closeBox)
  210.         case(normal-esc) {
  211. label(39)
  212.             gotoSplit(buf[Old_CurFile])
  213.             splitWindow(Hyper_Text_Buf,0)               .. close it if made it
  214.             clearBuf(Hyper_Word)
  215.             freeBuf(Hyper_Text_Buf)
  216.             putMsg(" ") putMsg("")
  217.             return
  218.         }
  219.         case(normal-buttonDown) {                      .. scroll, place cursor
  220.             moveCursor(curFile,mouseLoc)
  221.             updateDisplay
  222.             mouseXY(N_4,N_1)
  223.             equateNum(N_4,0)
  224.             if (mouseDown) while (not inputWaiting) {
  225.                 trackMouse
  226.                 mouseXY(N_2,N_3)
  227.                 sub(N_3,N_3,N_1)
  228.                 div(N_3,N_3,5)
  229.                 if (!eqNum(N_3,0))
  230.                     { vscroll(N_3) updateDisplay equateNum(N_4,1) }
  231.             }
  232.             if (eqNum(N_4,1)) refreshDisplay
  233.             GOTO Get_Next_Input
  234.         }
  235.         case(shft-buttonDown)
  236.         case(alt-buttonDown)
  237.         case(ctl-buttonDown)
  238.         case(rAmiga-buttonDown) {
  239.             runKey(Capture_Word)
  240. Lookup_Hyper_Word
  241.             if (gtNum(0,Word_Index)) equateNum(Word_Index,0)
  242.             if (eqNum(0,Word_Index)) {
  243. Lookup_From_Top                                      .. try from top of table
  244.                 if (!hyper(Hyper_Text_Buf2,Hyper_Word,Word_Index,0)) GOTO Get_Next_Input
  245.             } else {                                        .. try algorithm
  246.                 if (..!hyper(Hyper_Text_Buf2,Hyper_Word,Word_Index,1)
  247.                     ..&
  248.                     !hyper(Hyper_Text_Buf2,Hyper_Word,Word_Index,2)) GOTO Lookup_From_Top
  249.             }
  250.         }
  251.         case(normal-f1) {
  252.             clearBuf(Hyper_Word)
  253.             equateNum(Word_Index,0)         .. set index to 0 for top of tree
  254.                                              .. GOTO index word (top of tree)
  255.             if (!hyper(Hyper_Text_Buf2,Hyper_Word,Word_Index,0))
  256.                 GOTO Get_Next_Input
  257.         }
  258.         case(normal-f2) {
  259.             clearBuf(Hyper_Word)                 .. GOTO parent of Word_Index
  260.             if (!hyper(Hyper_Text_Buf2,Hyper_Word,Word_Index,1))
  261.                 GOTO Get_Next_Input
  262.         }
  263.         case(normal-f3) {
  264.             clearBuf(Hyper_Word)                  .. GOTO child of Word_Index
  265.             if (!hyper(Hyper_Text_Buf2,Hyper_Word,Word_Index,2))
  266.                 GOTO Get_Next_Input
  267.         }
  268.         case(normal-f4) {
  269.             clearBuf(Hyper_Word)           .. GOTO next sibling of Word_Index
  270.             if (!hyper(Hyper_Text_Buf2,Hyper_Word,Word_Index,3))
  271.                 GOTO Get_Next_Input
  272.         }
  273.         case(normal-f5) {
  274.             clearBuf(Hyper_Word)           .. GOTO prev sibling of Word_Index
  275.             if (!hyper(Hyper_Text_Buf2,Hyper_Word,Word_Index,4))
  276.                 GOTO Get_Next_Input
  277.         }
  278.         case(normal-f6) {
  279.             clearBuf(Hyper_Word)                          .. GOTO last lookup
  280.             if (!hyper(Hyper_Text_Buf2,Hyper_Word,Word_Index,5))
  281.                 GOTO Get_Next_Input
  282.         }
  283.         case(normal-w)
  284.         case(normal-gadget2)
  285.         case(normal-f7) {                              .. get hyper word input
  286.             putMsg("Input hyper word/phrase to look up:")
  287.             clearBuf(Hyper_Word)
  288.             runKey(Eat_MouseUp_Input)
  289.             GOSUB Forbid_Tiny_Window
  290.             inputString(Hyper_Word)
  291.             GOSUB Forbid_Tiny_Window
  292.             updateDisplay
  293.             GOSUB Paint_Options
  294.             GOTO Lookup_Hyper_Word
  295.         }
  296.         case(normal-f8) {                .. get hyper word of next index value
  297.             incNum(Word_Index)
  298.             clearBuf(Hyper_Word)
  299.             if (!hyper(Hyper_Text_Buf2,Hyper_Word,Word_Index,0)) {
  300.                 equateNum(Word_Index,0)
  301.                 GOTO Get_Next_Input
  302.             }
  303.         }
  304.         case(normal-f9) {                .. get hyper word of prev index value
  305.             if (gtnum(Word_Index,0)) decNum(Word_Index)
  306.             clearBuf(Hyper_Word)
  307.             if (!hyper(Hyper_Text_Buf2,Hyper_Word,Word_Index,0))
  308.                 GOTO Get_Next_Input
  309.         }
  310.         case(normal-kp8)
  311.         case(normal-uparrow) {
  312.             movecursor(curfile,upline)
  313.             updatedisplay
  314.             GOTO Get_Next_Input
  315.         }
  316.         case(normal-kp2)
  317.         case(normal-downarrow) {
  318.             movecursor(curfile,downline)
  319.             updatedisplay
  320.             GOTO Get_Next_Input
  321.         }
  322.         case(normal-kp4)
  323.         case(normal-leftarrow) {
  324.             movecursor(curfile,sWord)
  325.             updatedisplay
  326.             GOTO Get_Next_Input
  327.         }
  328.         case(normal-kp6)
  329.         case(normal-rightarrow) {
  330.             movecursor(curfile,eWord)
  331.             updatedisplay
  332.             GOTO Get_Next_Input
  333.         }
  334.         default { GOTO Get_Next_Input }
  335.     }
  336.     GOSUB Forbid_Tiny_Window
  337.     swapbuf(Hyper_Text_Buf2,Hyper_Text_Buf)
  338.     refreshDisplay
  339.     GOTO Get_Next_Input
  340.  
  341. Forbid_Tiny_Window ..SUBROUTINE label(40)  forbid tiny window
  342.     if (!inTiny) return
  343.     toggle(toTiny)
  344.     ..refreshDisplay
  345.     return
  346.  
  347. Paint_Options ..SUBROUTINE label(50) paint options in upper window
  348.     getAddress(10,N_4)      .. get maxLines
  349.     peek(N_4,N_1,2)
  350.     div(N_1,N_1,4)
  351.  
  352.     equateNum(N_3,6)
  353.     equateNum(N_2,2)
  354.     equateNum(N_4,0)
  355.  
  356.     text(" [ESC] [Q]uit",       0,0  ,N_3,N_1)
  357.     text(" [W]ord lookup",    0,N_1,N_2,N_1)
  358.     add(N_4,N_1,N_1)
  359.     text(" [N]ew Hyper File",  0,N_4,N_3,N_1)
  360.     add(N_4,N_4,N_1)
  361.     text(" [C]lose Hyper Text",0,N_4,N_2,-1)
  362.  
  363.     equateNum(N_4,1)
  364.     equateNum(N_1,2)
  365.  
  366.     text("F1: top of table",1,0,N_4,-1)
  367.     text("F2: parent of current",2,0,N_4,-1)
  368.     text("F3: child of current",3,0,N_4,-1)
  369.     text("F4: next sibling",4,0,N_4,-1)
  370.     text("F5: prev sibling",5,0,N_4,-1)
  371.     text("F6: step history",6,0,N_4,-1)
  372.  
  373.     text("RETURN/SPACE:  lookup cursor word",1,26,N_4,0)
  374.     text("MOUSE: cursor/scroll  ARROW KEYS: scroll",2,26,N_4,0)
  375.     text("S/A/C/R-MOUSE: lookup clicked word",3,26,N_4,0)
  376.  
  377.     text("F7: input word & lookup",4,23,N_4,0)
  378.     text("F8: next word by index",5,23,N_4,0)
  379.     text("F9: prev word by index",6,23,N_4,0)
  380.  
  381.     text(HT_FileName,6,50,N_4,0)
  382. >
  383.  
  384. <defines: >
  385.  
  386. GREP COMMANDS
  387.  
  388. <defines:
  389.     define(Do_A_Grep        ,virtual-f10)
  390.     define(Grep_Buf         ,buf49)
  391.     define(N_4              ,n4)
  392. >
  393.  
  394. Set grep (/search/replace/) string
  395. <lAmiga-f7:
  396.     putMsg("Input grep string:")
  397.     push(buf99,Grep_Buf)
  398.     movecursor(Grep_Buf,sfile)
  399.     movecursor(Grep_Buf,echar)
  400.     inputString(Grep_Buf)
  401.     setGrep(Grep_Buf)
  402.     runKey(lAmiga-f9)
  403. >
  404.  
  405. Called by grep cmds to perform grep based on N_4 flag
  406. <Do_A_Grep:
  407.     if (!grep(curFile,invert,N_4)) {
  408.         putMsg("Search failed")
  409.         returnFalse
  410.     } else putMsg("")
  411. >
  412.  
  413. Grep search forward
  414. <lAmiga-f9: equateNum(N_4,1) runKey(Do_A_Grep) >
  415.  
  416. Grep search backward
  417. <rAmiga-f9:  equateNum(N_4,-1) runKey(Do_A_Grep) >
  418.  
  419. Grep search & replace forward
  420. <lAmiga-f10: equateNum(N_4,2) runKey(Do_A_Grep) >
  421.  
  422. Grep search & replace backward
  423. <rAmiga-f10:  equateNum(N_4,-2) runKey(Do_A_Grep) >
  424.  
  425. <defines: >
  426.  
  427. BOOKMARK COMMANDS
  428.  
  429. ((Improvements included in the following bookmark cmds were contributed by
  430. Rene LeBlanc and Ken Perano.  3/5/91 RS))
  431.  
  432. <defines:
  433. define(Eat_MouseUp_Input,624)
  434. define(Select_BookMark  ,312)
  435. define(Display_Names    ,208)
  436. define(Cursor_To_Mark    ,virtual-gadget3)
  437. define(Dummy_Marks      ,virtual-gadget4)
  438. define(Mark_Name_List    ,buf60)
  439. define(N_0 ,n0)
  440. define(N_1 ,n1)
  441. define(BookMark_Number,n2)
  442. define(N_3 ,n3)
  443. define(N_4 ,n4)
  444. define(B_3 ,buf53)
  445. define(B_4 ,buf54)
  446. >
  447.  
  448. Goto bookmark
  449. <shft-gadget1:
  450.     if (!runKey(Select_BookMark)) returnFalse     .. select bkmark with mouse
  451.     runKey(Cursor_To_Mark) >
  452.  
  453. Goto next bookmark
  454. <shft-gadget2:
  455.     runKey(Dummy_Marks) .. fill Mark_Name_List with mark names if empty
  456.     incNum(BookMark_Number)
  457.     if (gtNum(BookMark_Number,7)) equateNum(BookMark_Number,0)
  458.     runKey(Cursor_To_Mark) >
  459.  
  460. Store bookmark at cursor
  461. <shft-gadget3:
  462.     runKey(Dummy_Marks) .. fill Mark_Name_List with mark names if empty
  463.     if (!runKey(Select_BookMark)) returnFalse .. get a bookmark to name
  464.  
  465.     .. get new bookmark name
  466.     moveCursor(Mark_Name_List,sFile)
  467.     do (N_4,0,BookMark_Number) moveCursor(Mark_Name_List,downLine)
  468.     moveCursor(Mark_Name_List,upLine)
  469.  
  470.     freeBuf(B_3)
  471.     insertRgn(B_3,eFile,Mark_Name_List,line)
  472.     putMsg("Enter bookmark name (1-10 chars):")
  473.     inputString(B_3)
  474.     if (!isEmpty(B_3)) {
  475.         clearRgn(Mark_Name_List,line)
  476.         moveCursor(B_3,sFile)
  477.         insertRgn(Mark_Name_List,atCursor,B_3,line)
  478.     }
  479.  
  480.     freebuf(B_4)
  481.     insertrgn(B_4,atcursor,"Mark = ",all)
  482.     insertRgn(B_4,eFile,B_3,line)
  483.     putmsg(B_4)
  484.  
  485.     switch(BookMark_Number) {
  486.         case (0) { equateLoc(curFile,locC,atCursor)  }
  487.         case (1) { equateLoc(curFile,locD,atCursor)  }
  488.         case (2) { equateLoc(curFile,locE,atCursor)  }
  489.         case (3) { equateLoc(curFile,locF,atCursor)  }
  490.         case (4) { equateLoc(curFile,locG,atCursor)  }
  491.         case (5) { equateLoc(curFile,locH,atCursor)  }
  492.         case (6) { equateLoc(curFile,locI,atCursor)  }
  493.         case (7) { equateLoc(curFile,locJ,atCursor)  }
  494.     }
  495. >
  496.  
  497. Used by bookmark cmds to move the cursor
  498. <Cursor_To_Mark:
  499.     moveCursor(Mark_Name_List,sFile)
  500.     do (N_4,0,BookMark_Number) moveCursor(Mark_Name_List,downLine)
  501.     moveCursor(Mark_Name_List,upLine)
  502.     freebuf(B_4)
  503.     insertRgn(B_4,eFile,Mark_Name_List,line)
  504.  
  505.     switch(BookMark_Number) {
  506.         case (0) { moveCursor(curFile,locC)  }
  507.         case (1) { moveCursor(curFile,locD)  }
  508.         case (2) { moveCursor(curFile,locE)  }
  509.         case (3) { moveCursor(curFile,locF)  }
  510.         case (4) { moveCursor(curFile,locG)  }
  511.         case (5) { moveCursor(curFile,locH)  }
  512.         case (6) { moveCursor(curFile,locI)  }
  513.         case (7) { moveCursor(curFile,locJ)  }
  514.     }
  515.     if (!eqNum(BookMark_Number,0) & is(curFile,sFile))
  516.         insertRgn(B_4,eFile," - May need to init marks (S-gadget4)",all)
  517.     putmsg(B_4)
  518. >
  519.  
  520.  
  521. Reset all bookmarks to sFile
  522. <shft-gadget4:
  523.     putmsg("Bookmarks reset")
  524.     freeBuf(Mark_Name_List)
  525.     runKey(Dummy_Marks) .. fill Mark_Name_List with mark names if empty
  526.     equateLoc(curfile,locC,sFile)
  527.     equateLoc(curfile,locD,eFile)
  528.     equateLoc(curfile,locE,sHilite)
  529.     equateLoc(curfile,locF,eHilite)
  530.     equateLoc(curfile,locG,sInvert)
  531.     equateLoc(curfile,locH,eInvert)
  532.     equateLoc(curfile,locI,locA)
  533.     equateLoc(curfile,locJ,locB)
  534.     equateNum(BookMark_Number,0)
  535. >
  536.  
  537. Put dummy bookmark names in Mark_Name_List
  538. <Dummy_Marks:
  539.     if (isEmpty(Mark_Name_List)) insertRgn(Mark_Name_List,eFile,
  540. "S File
  541. E File
  542. S Hilite
  543. E Hilite
  544. S Invert
  545. E Invert
  546. locA
  547. locB
  548. ",all)
  549. >
  550.  
  551. Display bookmark names in msg line
  552. <Display_Names:
  553.     updateDisplay
  554.     movecursor(Mark_Name_List,sFile)
  555.     equateNum(N_0,0)
  556.     equateNum(N_1,1)
  557.     getAddress(10,N_4) .. get maxLineChars
  558.     peek(N_4,N_3,2)
  559.     div(N_3,N_3,8)  .. chars per minigadget
  560.     do (N_4,0,7) {
  561.         clearBuf(B_4)
  562.         insertRgn(B_4,eFile,Mark_Name_List,line)
  563.         text(B_4,0,N_0,N_1,N_3)
  564.         if (eqNum(N_1,1)) equateNum(N_1,2)
  565.         else equateNum(N_1,1)
  566.         add(N_0,N_0,N_3)
  567.         moveCursor(Mark_Name_List,downLine)
  568.     }
  569. >
  570.  
  571. Select a bookmark with mouse
  572. <Select_BookMark:
  573.     runKey(Dummy_Marks) .. fill Mark_Name_List with mark names if empty
  574.     runKey(Display_Names) .. display bookmark names
  575.     runKey(Eat_MouseUp_Input)                    .. soak mouseUp
  576.  
  577.     getKeyVal(N_3,N_4)    .. get a mouse input
  578.     putMsg(" ")
  579.     putMsg("")
  580.     switch(N_3) {
  581.         case(normal-gadget1)
  582.         case(normal-gadget2)
  583.         case(normal-gadget3)
  584.         case(normal-gadget4)
  585.         case(shft-gadget1)
  586.         case(shft-gadget2)
  587.         case(shft-gadget3)
  588.         case(shft-gadget4)  { nothing }
  589.         case(normal-f1) { equateNum(BookMark_Number,0) return }
  590.         case(normal-f2) { equateNum(BookMark_Number,1) return }
  591.         case(normal-f3) { equateNum(BookMark_Number,2) return }
  592.         case(normal-f4) { equateNum(BookMark_Number,3) return }
  593.         case(normal-f5) { equateNum(BookMark_Number,4) return }
  594.         case(normal-f6) { equateNum(BookMark_Number,5) return }
  595.         case(normal-f7) { equateNum(BookMark_Number,6) return }
  596.         case(normal-f8) { equateNum(BookMark_Number,7) return }
  597.         default { returnFalse }
  598.     }
  599.     getAddress(10,N_4)
  600.     peek(N_4,N_1,2) .. get maxLineChars
  601.     div(N_1,N_1,8)  .. 8 minigadgets, chars per minigadget
  602.     mouseXY(N_4,N_3)
  603.     getFont(B_4,N_0,N_3) .. get font sizeX
  604.     div(N_4,N_4,N_0)
  605.     div(BookMark_Number,N_4,N_1)
  606.     runKey(Eat_MouseUp_Input)
  607.     returnTrue
  608. >
  609.  
  610. <defines: >
  611.